﻿function Load-Configuration
{
	[CmdletBinding()]
	param(
		[parameter(Position=0)]	
		[string]$binaryDir = "",
		[parameter(Position=1)]	
		[string]$configName = "Local"
	)
	
	if ($binaryDir -eq "") {
		$binaryDir = (Get-Item (Get-Location)).Parent.FullName
	}
	

	$settingsDir = "$binaryDir\Settings\$configName\"	
	$configPath = "$settingsDir\Settings.xml"

	Set-Variable XmlConfig ([xml](Get-Content -Path $configPath)) -Scope Global
	$XmlConfig.Root.SetAttribute("ConfigName", $configName)
	$XmlConfig.Root.SetAttribute("BinariesDir", $binaryDir)
	$XmlConfig.Root.SetAttribute("SettingsDir", $settingsDir)
    
	$version = "1.2 beta"
	$releaseDate = "02/19/2014"
	Write-Host "`nSharePoint Content Deployment Console version $version" -foregroundcolor yellow
	Write-Host "by Ayoub Umoru - My blog http://www.HanseaTech.com ayoub@umoru.de" -foregroundcolor yellow
	Write-Host "Release date $releaseDate" -foregroundcolor yellow
	Write-Host "`nCheck for updates! http://contentdeployment.codeplex.com" -foregroundcolor yellow
	Write-Host "`nWant more functionality? - http://contentdeployment.codeplex.com/discussions `n`n" -foregroundcolor yellow
	Write-Host "`nYou found bugs? - http://contentdeployment.codeplex.com/discussions `n`n" -foregroundcolor yellow
	
	Write-Host "New in this release" -foregroundcolor green
	Write-Host "`t-`tAdded SharePoint 2013 support." -foregroundcolor green
	Write-Host "`t-`tIgnore the feature requirements from the destination farm with Run-ContentDeploymentJobForImport -IgnoreRequirements=$true." -foregroundcolor green
	Write-Host "`t-`tRe-Create new SiteCollection if already exist with Run-ContentDeploymentJobForImport -ReCreateSiteCollection=$true." -foregroundcolor green
	Write-Host "`t-`tCreate new SiteCollection if not exist with Run-ContentDeploymentJobForImport -CreateIfNotExistSiteCollection=$true." -foregroundcolor green
	Write-Host "`t-`tReset to default MasterPage after deployment with Run-ContentDeploymentJobForImport -DefaultMasterPage=$true." -foregroundcolor green
	
	Write-Host "`t `tDeploy content from SharePoint2010 to SharePoint2013 and vice versa with Run-ContentDeploymentJobForImport -OverrideSchemaVersion '15.0.0.0'" -foregroundcolor green


}